/*******************************
 *          Poker.h            *
 * ****************************/

#ifndef POKER_H
#define POKER_H

#include <QtCore>
#include <QtGui>
#include <QtDeclarative/QDeclarativeView>
#include <vector>
#include <string>
#include "JBevaluator.h"

using std::vector;
using std::string;

const int PAYOUT[10][5] = {
    {0,0,0,0,0},
    {1,2, 3, 4, 5},
    {2,4, 6, 8, 10},
    {3, 6, 9, 12, 15},
    {4, 8, 12, 16, 20},
    {6, 12, 18, 24, 30},
    {9, 18, 27, 36, 45},
    {25, 50, 75, 100, 125},
    {50, 100, 150, 200, 250},
    {250, 500, 750, 1000, 4000}
};

class Poker : public QMainWindow
{
    Q_OBJECT

public:
    Poker();
    ~Poker();

private:
    void init();
    void dealCard(int cc, QString qcard);
    void placeBet();
    void updateMoney();
    void evaluateHand();

private slots:
    void dealNewHand();
    void dealRound();
    void betIncrease();
    void betDecrease();

private:
    QDeclarativeView *view;
    QObject *viewroot;
    QObject *cards;
    QObject *betplus;
    QObject *betminus;
    QObject *dealbutton;
    QObject *quitbutton;
    QObject *message;
    QObject *cardpoint;

    int hand_[5];
    vector<QVariant> cardpics;
    int money_;
    int bet_;
    JBEvaluator evaluator_;

};

#endif
